﻿@model  IEnumerable<CP_SchoolForChildren_v0._1.Models.RelatedModel.DetailOfSchool>
@using CP_SchoolForChildren_v0._1.Models.DataModel;
@{
    ViewBag.Title = "So Sánh Các Trường";
    Layout = "~/Views/Shared/FE/_Layout_FE_Index.cshtml";
    SFCEntities db = new SFCEntities();
}
<link href="@Url.Content("~/Content/FE/Addition.css")" rel="stylesheet" type="text/css" />

<div class="allhome" style="padding-top: 15px;">
    <!---BEGIN COMPARE Form--->
        <h2 style="padding: 10px; color: #774F38;">So sánh chi tiết</h2>
        @{var z = 0; var t = 5;}
        <table id="compare-table">
            <tr id="compare-tr">
                <th class="diagram1">Tên Trường</th>
                @foreach (var item in Model)
                {
                    if (Model.Count() == 2)
                    {
                    <td class="linkname" style="width:400px;">@Html.ActionLink(item.SchoolName, "Detail", new { schoolID = item.SchoolID })</td>
                    }
                    else if (Model.Count() == 3)
                    {
                    <td class="linkname" style="width:260px;">@Html.ActionLink(item.SchoolName, "Detail", new { schoolID = item.SchoolID })</td>
                    }
                    else
                    {
                    <td class="linkname" style="width:200px;">@Html.ActionLink(item.SchoolName, "Detail", new { schoolID = item.SchoolID })</td>
                    }
                }
            </tr>
            <tr id="compare-tr">
                <th class="diagram1">Loại Hình</th>
                @foreach (var item in Model)
                { 
                    <td class="diagram">@item.TypeName</td>
                }
            </tr>
            <tr id="compare-tr">
                <th class="diagram1">Địa chỉ</th>
                @foreach (var item in Model)
                { 
                    <td class="diagram">@item.Address - @item.DistrictName - @item.CityName</td>
                }
            </tr>
            <tr id="compare-tr">
                <th class="diagram1">SĐT</th>
                @foreach (var item in Model)
                { 
                    <td class="diagram">@item.Phone</td>
                }
            </tr>
            <tr id="compare-tr">
                <th class="diagram1">Website</th>
                @foreach (var item in Model)
                { 
                    <td class="diagram">@item.Website</td>
                }
            </tr>
            <tr id="compare-tr">
                <th class="diagram1">Email</th>
                @foreach (var item in Model)
                { 
                    <td class="diagram">@item.Email</td>
                }
            </tr>
            <tr id="compare-tr">
                <th class="diagram1">Ban Giám Hiệu</th>
                @foreach (var item in Model)
                { 
                    <td class="diagram">@item.Principal</td>
                }
            </tr>
            <tr id="compare-tr">
                <th class="diagram1">Chương Trình Học</th>
                @foreach (var item in Model)
                { 
                    <td class="diagram">@item.Program</td>
                }
            </tr>
            <tr id="compare-tr">
                <th class="diagram1">Diện Tích</th>
                @foreach (var item in Model)
                { 
                    <td class="diagram">@item.Area m2</td>
                }
            </tr>
            <tr id="compare-tr">
                <th class="diagram1">Thời Gian Tuyển Sinh</th>
                @foreach (var item in Model)
                { 
                    <td class="diagram">@item.EnrollmentTime</td>
                }
            </tr>
            <tr id="compare-tr">
                <th class="diagram1">Độ Tuổi Tuyển Sinh</th>
                @foreach (var item in Model)
                { 
                    <td class="diagram">@item.AcceptAgeDescription</td>
                }
            </tr>
            <tr id="compare-tr">
                <th class="diagram1">Thủ Tục Nhập Học</th>
                @foreach (var item in Model)
                { 
                    <td class="diagram">@Html.Raw(@item.Admission)</td>
                }
            </tr>
            <tr id="compare-tr">
                <th class="diagram1">Năm Thành Lập</th>
                @foreach (var item in Model)
                { 
                    <td class="diagram">@item.EstablishYear</td>
                }
            </tr>
            <tr id="compare-tr">
                <th class="diagram1">Tổng Số Giáo Viên</th>
                @foreach (var item in Model)
                { 
                    <td class="diagram">@item.NumberOfTeacher</td>
                }
            </tr>
            <tr id="compare-tr">
                <th class="diagram1">Tổng Số Học Sinh</th>
                @foreach (var item in Model)
                { 
                    <td class="diagram">@item.NumberOfChildren</td>
                }
            </tr>
            <tr id="compare-tr">
                <th class="diagram1">Học Phí</th>
                @foreach (var item in Model)
                { 
                    <td class="diagram">@item.TuitionFee.ToString("#,#.") 000 VNĐ</td>
                }
            </tr>
            <tr id="compare-tr">
                <th class="diagram1">Dịch Vụ</th>
                @foreach (var item in Model)
                {
                    var schoolFirst = (from s1 in db.Services
                                       join ss in db.SchoolServices on s1.ServiceID equals ss.ServiceID
                                       join s in db.Schools on ss.SchoolID equals s.SchoolID
                                       where s.SchoolID == @item.SchoolID
                                       select s1.ServiceName).ToList();
                    <td class="diagram">@for (var ur = 0; ur < schoolFirst.Count(); ur++)
                                        {
                                            @schoolFirst[ur];
                                            <br />
                                        }
                    </td>
                }
            </tr>
            <tr id="compare-tr">
                <th class="diagram1">Thông Tin Thêm</th>
                @foreach (var item in Model)
                { 
                    <td class="diagram">@item.Description</td>
                }
            </tr>
        </table>
</div>